Static IP for Raspberry Pi

Following instructions here: [Give Your Raspberry Pi a Static IP Address](https://blog.richardkeller.net/how-to-give-your-raspberry-pi-a-static-ip-address-so-that-you-can-access-it-from-anywhere-2/)

First connect pi to network and find its dynamically assigned IP address.

I did it from the eero app, can also get a list of all the devices connected to the local network by running the following command on the MAC terminal

arp -a

once you have the current ip connect to the pi eg:

ssh pi@192.168.0.7

Edit /etc/dhcpcd.conf

Uncomment the following lines. I then set the static ipaddress (in the 2nd line below) to be the one that was dynamically assigned. #+BEGINSRC bash

Example static IP configuration:

interface eth0 static ipaddress=192.168.4.38/24 static ip6address=fd51:42f8:caae:d92e::ff/64 static routers=192.168.0.1 static domainnameservers=192.168.0.1 8.8.8.8 fd51:42f8:caae:d92e::1

#+ENDSRC

Restart the raspberry pi

sudo reboot

Setup up port fowarding

I was able to do this on the eero app.

Set the port range to: 222-2222 Use both TCP & UDP

Edit /etc/ssh/sshdconfig

Adding the line

Port 2222

save the file and reload with

service ssh reload

Get your public IP

https://www.whatsmyip.org/ mine is: 24.3.217.26

Links:

RaspberryPi720

202407201059